<template>
    <view class="wrap">
        <image class="imgSuccess" src="/static/activity/pay_success.png" mode=""></image>

        <view v-if="page==1">
            <view class="amount">
                <text class="amount_unit">¥</text>
                <text class="amount_price">{{totalPrice}}</text>
            </view>
            <text>付款成功</text>
        </view>
        
        <view v-if="page==2" style="text-align: center;font-weight: bold;">
            <view>订单提交成功</view>
            <view>工作人员会尽快确认</view>
        </view>

        <view class="navi">
            <view class="btn leftBtn" @click="goHome">
                返回首页
            </view>
            <!-- <view class="btn rightBtn" @click="goOrder">
                查看订单
            </view> -->
        </view>
    </view>
</template>

<script>
export default {
    data() {
        return {
            totalPrice: 0,
            orderId: 0,
            page: 1,
        }
    },
    onLoad(op) {
        this.totalPrice = op.totalPrice;
        this.orderId = op.orderId;
        this.page = op.page;
    },
    methods: {
        goHome() {
            uni.switchTab({
                url: '/pages/home/home'
            });
        },
        goOrder() {
            uni.redirectTo({
                url: `../../pagesB/mine/car-orderlist/car-orderdetail?id=${this.orderId}`,
            });
        },
    },
}
</script>

<style lang="scss" scoped>
page {
    background-color: #fff;
}
.wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    .imgSuccess {
        width: 180upx;
        height: 180upx;
        margin-top: 75upx;
    }
}

.amount {
    display: flex;
    align-items: flex-end;
    margin-top: 50upx;
    &_unit {
        font-size: 30upx;
        font-family: PingFang SC, PingFang SC-Bold;
        font-weight: bold;
        text-align: center;
        color: #333333;
        position: relative;
        top: -10upx;
    }
    &_price {
        font-size: 60upx;
        font-family: PingFang SC, PingFang SC-Bold;
        font-weight: bold;
        text-align: center;
        color: #333333;
    }
}

.navi {
    margin-top: 80upx;
    display: flex;
    align-items: center;
}

.btn {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 280upx;
    height: 80upx;
    font-size: 28upx;
    font-family: PingFang SC, PingFang SC-Bold;
    font-weight: bold;
    text-align: center;
    border-radius: 40upx;
}

.leftBtn {
    border: 2upx solid #12baa4;
    color: #12baa4;
    margin-right: 30upx;
}

.rightBtn {
    background-color: #12baa4;
    color: #fff;
}
</style>
